/*
 * @lc app=leetcode.cn id=1598 lang=javascript
 *
 * [1598] 文件夹操作日志搜集器
 */

// @lc code=start
/**
 * @param {string[]} logs
 * @return {number}
 */
var minOperations = function (logs) {
  let stack = [];
  logs.forEach((item) => {
    switch (item) {
      case "../":
        stack.pop();
        break;
      case "./":
        break;
      default:
        stack.push(1);
    }
  });
  return stack.length;
};
// @lc code=end
